<?php use_stylesheet('/enermaatik/isik.css') ?>
<?php slot('article') ?>
<?php include_component('headerMenu', 'breadCrumbs') ?>
<div class="clear"></div>
<?php $redirect = $sf_request->getParameter('redirect');?>
<?php if($redirect): ?>
<?php include_partial('basketPage/progress', array('step' => 'register')) ?>
<?php endif; ?>
<form action="<?php echo LinkGen::getInstance(LinkGen::STRUCTURE_ACTIONS)->link($node['id'], array('module' => 'publicUserRegistration', 'action' => 'submit')) ?>" method="post">
<?php echo $form->renderHiddenFields(true) ?>
<div class="ccontentbox">
	<div class="ccontent">
		<div class="korvsisu">
			<h1><?php echo __('Registreerimine') ?></h1>
			<div id="comment_flashes" style="padding:10px"></div>
			
			<div class="korvinfobox andmed">
				<!--
				<div class="andmerow">
					<div class="arowname">
						<p>Salutation</p>

					</div>
					<div class="aform">
						<div class="dropdown">
							<div class="dropdownleft"><img src="/enermaatik/img/dropleft.png" width="6" height="23" alt=""/></div>
							<div class="drop">
								<div class="droptext">Mr</div>
							</div>
							<div class="dropdownright"><img src="/enermaatik/img/dropright.png" width="25" height="23" alt=""/></div>

							<div class="clear"></div>
							<div class="hiddendrop">
								<div class="hiddenbox">
									<ul>
										<li>
											<a href="">5 m</a>
										</li>
										<li>

											<a href="">10 m</a>
										</li>
									</ul>
								</div>
							</div>
						</div>
					</div>
					<div class="akohustlik">

						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>
					<div class="clear"></div>
				</div>
				-->
				<div class="andmerow">
					<div class="arowname">
						<p>First Name</p>
					</div>

					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['first_name']->render(array('class' => 'ainput'))  ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
					</div>

					</div>
					<div class="akohustlik">
						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p>Last Name</p>

					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['last_name']->render(array('class' => 'ainput'))  ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>

					</div>
					</div>
					<div class="akohustlik">
						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">

						<p>Your Email</p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['email']->render(array('class' => 'ainput'))  ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>

						<div class="clear"></div>
						</div>
					</div>
					<div class="akohustlik">
						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>
					<div class="clear"></div>
				</div>

				<div class="andmerow">
					<div class="arowname">
						<p>Confirm Email</p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['email_confirm']->render(array('class' => 'ainput'))  ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
						</div>
					</div>
					<div class="akohustlik">
						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>

					<div class="clear"></div>
				</div>

				<div class="andmerow">
					<div class="arowname">
						<p>Password</p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['password']->render(array('class' => 'ainput'))  ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
					</div>
					</div>
					<div class="akohustlik">
						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>
					<div class="clear"></div>
				</div>

				<div class="andmerow">
					<div class="arowname">
						<p>Phone</p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['phone']->render(array('class' => 'ainput'))  ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
						</div>
					</div>

					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('Soovin saada uudiskirju'); ?></p>
					</div>
					<div class="aform">
                                                <?php echo $form['newslist']->render(array('style' => 'margin-top:10px;')) ?>
					</div>

					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p>Captcha code</p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['captcha']->render(array('class' => 'ainput'))  ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
						</div>
					</div>
					<div class="akohustlik">
						<div id="captcha_refresh" class="refresh"><img src="/enermaatik/img/refresh.png" width="26" height="36" alt=""/></div>
						<img id="captcha_image" src='<?php echo url_for('sf_captchagd', array('r' => time() ) ) ?>' alt="" />
					</div>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="ccontentmainbottom"></div>
		<div class="clear"></div>
		<div class="tablebuttons">
			<div class="hallbutton" id="register_button">
				<div class="hallbuttonleft"><img src="/enermaatik/img/tbl.png" width="8" height="26" alt=""/></div>
				<div class="hallbuttoncenter">
					<p><a href="#"><?php echo __('Registreerin')?></a></p>
				</div>

				<div class="hallbuttonright"><img src="/enermaatik/img/tbr.png" width="8" height="26" alt=""/></div>
				<div class="clear"></div>
			</div>

			<div class="clear"></div>
		</div>
	</div>
</div>
</form>
<script type="text/javascript">

$('#register_button').click(function(e){
	e.preventDefault();

	var button = $(this);
	var form = $(this).parents('form');
	button.hide();
	
	$('#comment_flashes').html('');
	$.post(form.attr('action'), form.serialize(), function(data){
		if(data.status == 200){
			$('#comment_flashes').html(data.shortMessage);
			window.location.href = '<?php echo $redirectLink ?>';
		}else{
			for (var i in data.messages ){
				$('#comment_flashes').html( $('#comment_flashes').html() + "<br />" +  data.messages[i]);
			}
			button.show();
		}
	},'json');
	
	return false;
});

$('#captcha_refresh').click(function(e){
	e.preventDefault();
	$('#captcha_image').attr('src','<?php echo url_for('sf_captchagd', array('reload' => 1 ) ) ?>' + '&r=' + Math.random());
	return false;
});

$('.radio').click(function(){
$('.radio').removeClass("active");
$(this).addClass("active");
});
</script>
<script type="text/javascript">
$('.pankradio').click(function(){
$('.pankradio').removeClass("active");
$(this).addClass("active");
});
</script>
<script type="text/javascript">
$('.checkbox').click(function(){
$('.checkbox').addClass("active");
});
</script>

<?php end_slot() ?>